RefreshControls
Definition:
RefreshControls([control])
Description:
Updates input value(s) in a specified control or all controls on a form from the current record in the relevant Data Source(s)
AND for Web Service Data Sources can send data to the Web Service (see Notes below).
Platforms:
All
Parameters:
control - optional
Name of the control to refresh. Omit if you want all controls on the form to be updated.
Returns:
nothing
Notes:
-
For Web Service Data Sources, RefreshControls can be used not only to read in data from the Web Service but also to send out data to the Web Service.
Each Table within a Web Service data mapping has a Modify Action Online Property, which can be set to Local or Direct. This Property only takes effect when the mobile device is online.
If set to Local, and the mobile device is online, RefreshControls reads data from the current record of the local database and uses these values to update the control(s).
If set to Direct, and the mobile device is online, RefreshControls calls the Web Service to download data to update the local database on the mobile device and then to update the control(s) from the current record. The call to the Web Service also includes data to be uploaded to the Web Service within the same call. The data sent to the Web Service consists of the current values in any controls which have an output mapping to a data element in a Table in the Web Service data mapping which has the Modify Action Online Property set to Direct. Note, however, that only controls which have been displayed on any form prior to the RefreshControls being called will be included in the data sent to the Web Service.
If the mobile device is offline, then the Modify Action Online Property has no effect. In this case, the Digitise Apps Client will act as if this Property were set to Local, whatever the value of the Property.
-
If the Modify Action Online Property is set to Direct, such that the data values sent to the Web Service will be the current values in the controls, RefreshControls doesn't read any values from the current record in the local database before sending the output mappings to the Web Service. Any default values you have specified for elements within a Data Source relate solely to the creation of records within the local database and are not automatically entered into controls. Consequently, any controls which have data elements from the Web Service as output mappings must be initialized before this call, especially if you want to input default values for unedited controls.
Failure to initialize the output controls before calling this Method will result in an error being generated.
The Modify Action Online Property only affects Web Service Data Sources. For more information see Adding a RESTful Web Service Data Source, Adding a SOAP Web Service Data Source and Adding an awi Web Service Data Source.
-
-
RefreshControls doesn't send data to the remote data source when used with Web API Data Sources.
-
If a control is input mapped to a Custom View, the value in the control will be updated using the View. Remember you can refine the records which will be included in the View, if necessary, by calling SetSelectString and specifying a 'where' clause before calling RefreshControls.
-
Note that with Ink Picture Controls, RefreshControls does not clear user added drawing or writing from this control. If you want to clear user input, you will need to use ClearControl before calling RefreshControls.